﻿// 创建一个新文件 RevitExternalEventHandler.cs
using Autodesk.Revit.UI;
using System;

namespace RevitProject.Helper
{
    public class RevitExternalEventHandler : IExternalEventHandler
    {
        private readonly Action<UIApplication> _action;

        public RevitExternalEventHandler(Action<UIApplication> action)
        {
            _action = action;
        }

        public void Execute(UIApplication app)
        {
            _action?.Invoke(app);
        }

        public string GetName()
        {
            return "RevitExternalEventHandler";
        }
    }
}